import com.example.demo.service.PersonService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class tetst1 {
    public static void main(String[] args) {

        //获取IOC容器
        ApplicationContext app  = new ClassPathXmlApplicationContext("applicationContext.xml");

        //获取bean
//        PersonService personservice = (PersonService) app.getBean("personservice");
        PersonService personservice = app.getBean(PersonService.class);
        personservice.drink();


    }
}
